package com.froggyware.tadpole.query;

import com.froggyware.tadpole.TadObject;

import java.util.List;

/**
 * Created by IntelliJ IDEA.
 * User: mst
 * Date: Sep 5, 2011
 * Time: 5:36:43 PM
 * To change this template use File | Settings | File Templates.
 */
public class EntitySelector implements Selector {

    private Class entityClass;

    public EntitySelector(Class entityClass) {
        this.entityClass = entityClass;
    }

    @Override
    public boolean select(TadObject entity) {
        if (entityClass.isAssignableFrom(entity.getClass())) {
            return true;
        }
        return false;
    }
}
